package principal;

public class Ponto {

	private double x;
	private double y;
	private double z;
	private Vetor normal;
	
	public Ponto(double x, double y, double z) {
		this.x = x;
		this.y = y;
		this.z = z;
		normal = new Vetor(0, 0, 0);
	}

	public Ponto soma(Ponto p){
		Ponto ret = new Ponto(this.x + p.getX(), this.y + p.getY(), this.z + p.getZ());
		return ret;
	}
	
	public Vetor toVetor(){
		return new Vetor(this.x , this.y, this.z);
	}
	
	public Vetor subtrai(Ponto p){
		return new Vetor(this.x -p.x , this.y - p.y , this.z - p.z );
	}
	
	public void somarVetorNormal(Vetor v){
		normal = normal.soma(v);
	}
	
	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}

	public double getZ() {
		return z;
	}

	public void setZ(double z) {
		this.z = z;
	}
	
	public Vetor getNormal() {
		return normal;
	}
	
	public void setNormal(Vetor normal) {
		this.normal = normal;
	}
	
	public void adicionaComponenteNormal(Vetor componente) {
		this.normal = this.normal.soma(componente);
	}
	
}
